package com.example.project.dao;

import com.example.project.dao.sqls.TableAProvider;
import com.example.project.entity.TableA;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by Ethan on 2022-08-24 22:38
 */
@Mapper
public interface TableADao {
    @SelectProvider(type = TableAProvider.class, method = "findAllSql")
    List<TableA> findAll();

    @SelectProvider(type = TableAProvider.class, method = "likeSql")
    List<TableA> findByName(String s);

    @InsertProvider(type = TableAProvider.class, method = "insertSql")
    void saveTableA(TableA tableA);

    @DeleteProvider(type = TableAProvider.class, method = "deleteSql")
    void deleteByName(int id);

    @UpdateProvider(type = TableAProvider.class, method = "updateSql")
    void update(TableA tableA);

    @SelectProvider(type = TableAProvider.class, method = "getSumAaSql")
    int getSumOfAa();

    @SelectProvider(type = TableAProvider.class, method = "getSumBbSql")
    int getSumOfBb();

    @SelectProvider(type = TableAProvider.class, method = "getSumCcSql")
    int getSumOfCc();

    @SelectProvider(type = TableAProvider.class, method = "getSumDdSql")
    int getSumOfDd();

    @SelectProvider(type = TableAProvider.class, method = "getSumEeSql")
    int getSumOfEe();
}
